﻿using Hangjing.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Hangjing.SQLServerDAL;

namespace Html5.shop
{
    public partial class publishorder : shopPageBase
    {
        IList<shopdeliveryInfo> list;

        protected void Page_Load(object sender, EventArgs e)
        {
            UserHelp.IsLogin_Togo(Request.Url.PathAndQuery);

            PointsInfo togoinfo = UserHelp.GetUser_Togo();

            togoinfo = new Points().GetModel(togoinfo.Unid);



            WebUtility.BindRepeater(rptfastremark,  CacheHelper.GetShopSTemplateList().Where(a =>  a.Status == togoinfo.cityid).ToList());
            int shopid = togoinfo.Unid;
           
            if (togoinfo.SN1 == "2")
            {
                togoinfo.Introduce = "";
                list = new shopdelivery().GetListByTogoNum(shopid);
            }

            IList<PointsInfo> shops = new List<PointsInfo>();
            shops.Add(togoinfo);

            hftid.Value = shopid.ToString();
            hfmymoney.Value = togoinfo.money + "";

            WebUtility.BindRepeater(rptorder, shops);

            IList<CityInfo> citys = CacheHelper.GetCityList();
            foreach (var item in citys)
            {
                if (item.cid == togoinfo.cityid)
                {
                    hfcityname.Value = item.cname.ToString();
                    break;
                }
            }

            if (togoinfo.cityid == 6)
            {
                selfdispach.Visible = false;
            }

            

        }


        public IList<shopdeliveryInfo> getShopLaw()
        {
            return list;
        }
    }



}